from layer import Layer
from neutron_network_model import NeutronNetworkModel
from prepare_dataset import load_dataset
import matplotlib.pyplot as plt

if __name__ == '__main__':
    X, y, X_train, X_test, y_train, y_test = load_dataset()

    model = NeutronNetworkModel()
    # print(model.abc)
    # print(model.__layers)

    model.add_layer(Layer(2, 25, 'sigmoid'))
    model.add_layer(Layer(25, 50, 'sigmoid'))
    model.add_layer(Layer(50, 25, 'sigmoid'))
    model.add_layer(Layer(25, 2, 'sigmoid'))

    mses, accuracys = model.train(X_train, X_test, y_train, y_test, 0.001, 10000)
    print(mses)
    # 绘制误差和准确率的图

    times = [i * 10 for i in range(len(mses))]

    plt.plot(times, mses, color='red')
    plt.show()

    plt.plot(times, accuracys, color='blue')
    plt.show()






